package com.kgc.scd.Controller;

import com.kgc.scd.entity.ShopOrder;
import com.kgc.scd.service.ShopOrderServerService;
import com.kgc.scd.vo.ShopOrderVO;
import com.kgc.scd.vo.ShopOrderitemVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created On : 2022/11/16.
 * <p>
 * Author : Administrator
 * <p>
 * Description: OrderServerController
 */
@Slf4j
@RestController
@Api(tags = "服务端订单接口")
public class OrderServerController {

    @Autowired
    private ShopOrderServerService shopOrderServerService;


    @GetMapping("/getShopOrderById")
    @ApiOperation(value = "通过id获取订单信息")
    public ShopOrderVO getShopOrderById(String orderId){

        return shopOrderServerService.getShopOrderById(orderId);
    }

    @PostMapping("/updateShopOrder")
    @ApiOperation(value = "修改订单状态")
    public void updateShopOrderStatus(@RequestBody ShopOrderVO shopOrderVO){


        shopOrderServerService.updateSHopOrderStatus(shopOrderVO);
    }


    @GetMapping("/delOrderById")
    public void delOrderById(String orderId){
        shopOrderServerService.delOrderById(orderId);
    }

}
